<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>重定向页面</title>
    <link rel="stylesheet" type="text/css" href="./css/api.css" />
    <script type="text/javascript" src="./script/api.js"></script>
</head>

<body>
</body>

</html>
<script type="text/javascript" src="script/api.js"></script>
<script type="text/javascript">
apiready = function() {
         setTimeout('api.removeLaunchView();', 3000);

      //  $api.rmStorage('userInfor');
         var userInfor = $api.getStorage('userInfor');
         //判断缓存中是否存在，判断是否登录的状态s
         if ( typeof (userInfor) != "undefined") {
                 api.openWin({
                         name : 'root',
                         url : 'index.html',
                         bounces : false,
                         opaque : false,
                         showProgress : true,
                         vScrollBarEnabled : false,
                         hScrollBarEnabled : false,
                         slidBackEnabled : false,
                         delay : 300,
                         animation : {
                                 duration : 400
                         }
                 });
         } else {
                 api.alert({
                     title: "未登入",
                     msg: '请先登入',
                 }, function(ret, err){
                     if( ret ){
                       api.openWin({
                               name : 'login',
                               url : 'html/login.html',
                               bounces : false,
                               opaque : false,
                               showProgress : true,
                               vScrollBarEnabled : false,
                               hScrollBarEnabled : false,
                               slidBackEnabled : false,
                               delay : 300,
                               animation : {
                                       duration : 400
                               }
                       });
                     }else{
                       api.closeWin({
                           name: 'root'
                       });

                     }
                 });


         }
 };


</script>
